﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Money_Dance
{
    public partial class Money_Dance : Form
    {
        public Money_Dance()
        {
            InitializeComponent();
        }

        UserCtr_Trangchu ctr_TC = new UserCtr_Trangchu();
        UserCtr_TaiKhoan ctr_TK = new UserCtr_TaiKhoan();
        UserCtr_Bieudo ctr_BD = new UserCtr_Bieudo();

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            UserCtr_Trangchu ctr_TC = new UserCtr_Trangchu();
            UserCtr_TaiKhoan ctr_TK = new UserCtr_TaiKhoan();
            UserCtr_Bieudo ctr_BD = new UserCtr_Bieudo();
            this.pnl_Timkiem.Visible = true;
            switch (e.Node.Text)
            {
                case "Trang chủ":                    
                    if (splitContainer1.Panel2.Controls.Count > 0)
                    {
                        this.splitContainer1.Panel2.Controls.Clear();
                    }
                    this.splitContainer1.Panel2.Controls.Add(ctr_TC);
                    break;
                case "TK Thu chi":
                    if (splitContainer1.Panel2.Controls.Count > 0)
                    {
                        this.splitContainer1.Panel2.Controls.Clear();
                    }
                    this.splitContainer1.Panel2.Controls.Add(ctr_TK);
                    break;
                case "TK Tiết kiệm":
                    if (splitContainer1.Panel2.Controls.Count > 0)
                    {
                        this.splitContainer1.Panel2.Controls.Clear();
                    }
                    this.splitContainer1.Panel2.Controls.Add(ctr_TK);
                    break;
                case "Biểu đồ":                   
                   if (splitContainer1.Panel2.Controls.Count > 0)
                   {
                       this.splitContainer1.Panel2.Controls.Clear();
                   }

                   splitContainer1.Panel2.Controls.Add(ctr_BD);
                    break;
            }
        }

        private void splitContainer1_Panel2_Paint_1(object sender, PaintEventArgs e)
        {

        }

        private void Money_Dance_Load(object sender, EventArgs e)
        {
            this.splitContainer1.Panel2.Controls.Add(ctr_TC);
        }


    }
}
